﻿<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />
<link rel="stylesheet" type="text/css" href="__ADMIN__/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="__ADMIN__/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="__ADMIN__/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="__ADMIN__/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="__ADMIN__/static/h-ui.admin/css/style.css" />
<link rel="stylesheet" type="text/css" href="__ADMIN__/layui/css/layui.css" />
<title>用户权限列表</title>
</head>
<body>
<!--<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 分类管理 <span class="c-gray en">&gt;</span> 模型管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>-->
<div class="page-container">
	<!--<form method="get" action="">-->
	<!--<div class="text-c">-->
		<!--<input type="text" class="input-text" style="width:250px" placeholder="输入模型名称"  id="tiaojian" name="tiaojian">-->
		<!--<button type="submit" class="btn btn-success" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜模型</button>-->
	<!--</div>-->
	<!--</form>-->
	{php}echo $str;{/php}
	<!--<div style="text-align: center">-->
		<!--<div id="test"></div>-->
	<!--</div>-->
</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="__ADMIN__/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="__ADMIN__/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="__ADMIN__/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="__ADMIN__/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="__ADMIN__/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<script type="text/javascript" src="__ADMIN__/lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 
<script type="text/javascript" src="__ADMIN__/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="__ADMIN__/layui/layui.all.js"></script>
<script type="text/javascript" src="__ADMIN__/js/Mao.js"></script>
<script type="text/javascript">
function del(obj,$url,$id) {
    layer.confirm('你确定要删除吗？', {
        btn: ['确定','取消'] //按钮
    }, function(){
        $.post($url,{id:$id},function (data) {
            console.log(data);
			if(data.code==200){
			    layer.msg(data.msg);
			    setTimeout(function () {
					window.location.reload();
                },1500)
			}else{
			    layer.msg(data.msg);
			}
        })
    });
}
function allDel($url) {
	var $id = Maowenke.getCheckbox();
    layer.confirm('你确定要删除吗？', {
        btn: ['确定','取消'] //按钮
    }, function(){
        $.post($url,{id:$id},function (data) {
            console.log(data);
            if(data.code==200){
                layer.msg(data.msg);
                setTimeout(function () {
                    window.location.reload();
                },1500)
            }else{
                layer.msg(data.msg);
            }
        })
    });
}
layui.use('laypage', function(){
    var laypage = layui.laypage;

    //执行一个laypage实例
    laypage.render({
        elem: 'test' //注意，这里的 test1 是 ID，不用加 # 号
        ,count: parseInt("{$data}") //数据总数，从服务端得到
		,layout:['count','prev','page','next','limit','refresh']
		,limits:[10,20,30,40,50,60,70,80,90,100]
		,jump:function (obj,first) {
			console.log(obj);
			var $cid = "{$cid}";
			if(!first){
			    $.post("{:url('document/pages')}",{cid:$cid,page:obj.curr,limit:obj.limit},function (datas) {
			        console.log(datas);
					if(datas.code==200){
						var $str = '';
						var $status = '';
						$.each(datas.data,function (i,v) {
						    if(v.status==1){
                                $status = '<span class="label label-success radius">已启用</span>';
							}else{
                                $status = '<span class="label radius">已禁用</span>';
							}
							$str +='<tr class="text-c">'+
                            '<td style="text-align: center"><input type="checkbox" value="'+v.id+'"></td>'+
                            '<td style="text-align: center">'+v.id+'</td>'+
                            '<td style="text-align: center">'+v.title+'</td>'+
                            '<td style="text-align: center">'+v.cid+'</td>'+
                            '<td style="text-align: center">'+v.model_id+'</td>'+
                            '<td style="text-align: center">'+Maowenke.ToString(v.dir)+'</td>'+
                            '<td style="text-align: center">'+$status+'</td>'+
                            '<td class="td-manage"> <a title="编辑" href="/admin/document/show_edit?id='+v.id+'" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a> <a title="删除" href="javascript:;" onclick="del(this,\'/admin/document/del\','+v.id+')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a></td>'+
                            '</tr>';
                        });
						$("tbody").empty();
						$("tbody").append($str);
					}else {
					    layer.msg(datas.msg);
					}
                })
			}
        }
    });
});
function getLinkageSelect(obj,$action) {
	console.log('haha');
}
</script>
<script type="text/javascript" src="__ADMIN__/layui/layui.all.js"></script>
<script>
</script>
</body>
</html>